import request from '@/utils/request'

export function page({ name, author, press, page, pageSize }) {
    return request({
        url: 'books/page',
        method: 'get',
        params: {
            name,
            author,
            press,
            page,
            pageSize
        }
    })
}

export function getById(isbn) {
    return request({
        url: 'books/' + isbn,
        method: 'get',
    })
}
export function update(Book) {
    return request({
        url: 'books/updateById',
        method : 'put',
        data : Book
    })
}

export function add(Book) {
    return request({
        url: 'books/add',
        method: 'post',
        data: Book,
    })
}

export function deleteById(isbn) {
    return request({
        url: 'books/'+isbn,
        method: 'delete'
    })
}